﻿using System;
using System.Collections.Generic;
using System.Text;
using HAVNet.Core.String;


namespace HAVNet.Intros.AST
{
    public class ASTVariableDeclarators : List<ASTVariableDeclarator>
    {
        public override string ToString()
        {
            return Strings.joinobjs(", ", this);
        }
    }

    public class ASTVariableDeclarator : ASTNode
    {
        public string ident { get; set; }
        public ASTVariableInitializer varInitializer { get; set; }

        public ASTVariableDeclarator()
        { }

        public ASTVariableDeclarator (string ident, ASTVariableInitializer variableInitializer)
        {
            this.ident = ident;
            this.varInitializer = variableInitializer;
        }

        public override string ToString()
        {
            if (varInitializer == null)
                return ident;
            else
                return ident + " = " + varInitializer.ToString(); //TODO:
        }
    }
}
